import request from '../../utils/request'

export function getPermissionPageList(data) {
    return request({
        url: '/uum-admin/api/v1/permission/page',
        method: 'get',
        params: data
    })
}

export function listPermissionByMenuId(data) {
    return request({
        url: '/uum-admin/api/v1/permission/list',
        method: 'get',
        params: data
    })
}

export function queryAllParent() {
    return request({
        url: '/uum-admin/api/v1/permission/listParent',
        method: 'get',
    })
}

export function permissionDetail(id) {
    return request({
        url: '/uum-admin/api/v1/permission/detail/'+ id,
        method: 'get'
    })
}


export function updatePermission(data) {
    return request({
        url: '/uum-admin/api/v1/permission/update',
        method: 'put',
        data
    })
}

export function addPermission(data) {
    return request({
        url: '/uum-admin/api/v1/permission/add',
        method: 'post',
        data
    })
}


export function deletePermission(ids) {
    return request({
        url: '/uum-admin/api/v1/permission/delete/'+ids,
        method: 'delete'
    })
}

export function generatorPerm(data) {
    return request({
        url: '/uum-admin/api/v1/permission/generatePerm',
        method: 'put',
        data
    })
}

